﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IDAL.Student;
using System.Reflection;
using System.Configuration;

namespace DALFactory
{
    public sealed class DataAccess
    {
        private static readonly string xmlPath = ConfigurationSettings.AppSettings["XmlDAL"];
        private static readonly string sqlitePath = ConfigurationSettings.AppSettings["SqliteDAL"];

        private DataAccess() { }

        /// <summary>
        /// Create XmlStudent
        /// </summary>
        /// <returns></returns>
        public static IStudent Create_Student()
        {
            return (IStudent)Assembly.Load(sqlitePath).CreateInstance(sqlitePath + ".Student.SqliteStudent");

            //return (IStudent)Assembly.Load(xmlPath).CreateInstance(xmlPath + ".Student.XmlStudent");
        }


    }
}
